<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Easy
  </div>
  <div>
   <h1 class="question_title">
    1013. Fibonacci Number
   </h1>
   <p>
    The&nbsp;
    <b>
     Fibonacci numbers
    </b>
    , commonly denoted&nbsp;
    <code>
     F(n)
    </code>
    &nbsp;form a sequence, called the&nbsp;
    <b>
     Fibonacci sequence
    </b>
    , such that each number is the sum of the two preceding ones, starting from
    <code>
     0
    </code>
    and
    <code>
     1
    </code>
    . That is,
   </p>
   <pre>
F(0) = 0,&nbsp; &nbsp;F(1)&nbsp;= 1
F(N) = F(N - 1) + F(N - 2), for N &gt; 1.
</pre>
   <p>
    Given
    <code>
     N
    </code>
    , calculate
    <code>
     F(N)
    </code>
    .
   </p>
   <p>
    &nbsp;
   </p>
   <p>
    <strong>
     Example 1:
    </strong>
   </p>
   <pre>
<strong>Input:</strong> 2
<strong>Output:</strong> 1
<strong>Explanation:</strong> F(2) = F(1) + F(0) = 1 + 0 = 1.
</pre>
   <p>
    <strong>
     Example 2:
    </strong>
   </p>
   <pre>
<strong>Input:</strong> 3
<strong>Output:</strong> 2
<strong>Explanation:</strong> F(3) = F(2) + F(1) = 1 + 1 = 2.
</pre>
   <p>
    <strong>
     Example 3:
    </strong>
   </p>
   <pre>
<strong>Input:</strong> 4
<strong>Output:</strong> 3
<strong>Explanation:</strong> F(4) = F(3) + F(2) = 2 + 1 = 3.
</pre>
   <p>
    &nbsp;
   </p>
   <p>
    <strong>
     Note:
    </strong>
   </p>
   <p>
    0 &le;
    <code>
     N
    </code>
    &le; 30.
   </p>
  </div>
  <div>
   <h1 class="question_title">
    1013. 斐波那契数
   </h1>
   <p>
    <strong>
     斐波那契数
    </strong>
    ，通常用&nbsp;
    <code>
     F(n)
    </code>
    表示，形成的序列称为
    <strong>
     斐波那契数列
    </strong>
    。该数列由&nbsp;
    <code>
     0
    </code>
    和
    <code>
     1
    </code>
    开始，后面的每一项数字都是前面两项数字的和。也就是：
   </p>
   <pre>F(0) = 0,&nbsp; &nbsp;F(1)&nbsp;= 1
F(N) = F(N - 1) + F(N - 2), 其中 N &gt; 1.
</pre>
   <p>
    给定&nbsp;
    <code>
     N
    </code>
    ，计算&nbsp;
    <code>
     F(N)
    </code>
    。
   </p>
   <p>
    &nbsp;
   </p>
   <p>
    <strong>
     示例 1：
    </strong>
   </p>
   <pre><strong>输入：</strong>2
<strong>输出：</strong>1
<strong>解释：</strong>F(2) = F(1) + F(0) = 1 + 0 = 1.
</pre>
   <p>
    <strong>
     示例 2：
    </strong>
   </p>
   <pre><strong>输入：</strong>3
<strong>输出：</strong>2
<strong>解释：</strong>F(3) = F(2) + F(1) = 1 + 1 = 2.
</pre>
   <p>
    <strong>
     示例 3：
    </strong>
   </p>
   <pre><strong>输入：</strong>4
<strong>输出：</strong>3
<strong>解释：</strong>F(4) = F(3) + F(2) = 2 + 1 = 3.
</pre>
   <p>
    &nbsp;
   </p>
   <p>
    <strong>
     提示：
    </strong>
   </p>
   <ul>
    <li>
     0 &le;
     <code>
      N
     </code>
     &le; 30
    </li>
   </ul>
  </div>
 </body>
</html>